package com.xxx.response;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ResposeDome01 extends HttpServlet {
    @Override                                 //通过HttpServletResponse来响应
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setHeader("name", "zhangsan");//设置响应头
        resp.getWriter().write("<h1>p01</h1>");//设置响应体
    }
}
